using System.Collections;
using System.Collections.Generic;
using UnityEngine;




public delegate void ParticlePlayOverCallback();

public class ParticlePlayOver : MonoBehaviour
{
    // Start is called before the first frame update

    public ParticlePlayOverCallback ParticlePlayOverCallback;

    void Start()
    {
        var main = GetComponent<ParticleSystem>().main;
        main.stopAction = ParticleSystemStopAction.Callback;
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    void OnParticleSystemStopped() {

        GameObject.Destroy(gameObject);
        // gameObject.SetActive(false);
        // if (ParticlePlayOverCallback != null)
        //     ParticlePlayOverCallback();
    }
}
